#!/usr/bin/env bash


function error_handler() {
  echo "Error occurred in script at line: ${1}."
    echo "Line exited with status: ${2}"
}

trap 'error_handler ${LINENO} $?' ERR

set -o errexit
set -o errtrace
set -o nounset

echo "Everything is running fine..."

# A command outside of a conditional that will always return a exit code of 1
test 1 -eq 0

echo "This will never run, as a command has failed"
echo "Using unset variable ${TEST} will also cause this script to exit"
